<template>
  <div class="page">
    <CommonList :requestUrl="requestUrl" :columns="columns" :queryFormItems="queryFormItems">
      <template v-slot:type>
        <el-table-column prop="type" label="类型" align="center" min-width="40">
          <template #default="{ row }">
            <el-tag effect="dark">{{ _options.getVal('couplet_type', row.type) }}</el-tag>
          </template>
        </el-table-column>
      </template>
    </CommonList>
  </div>
</template>
<script lang="ts" setup>
import CommonList from '@/components/CommonList.vue'
import { inject } from 'vue'

const _options: any = inject('_options')

const requestUrl = 'coupletList'

const columns = [
  { prop: 'top', label: '上联' },
  { prop: 'bottom', label: '下联' },
  { prop: 'center', label: '横批' },
  { prop: 'type', label: '类型', slot: 'type' },
  { prop: 'create_time', label: '创建时间' }
]
const queryFormItems = [
  // { prop: 'content', label: '内容' },
  { prop: 'type', label: '类型', type: 'option', optionName: 'couplet_type' }
]
</script>
